<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:oso="http://osoftware.com/facelets"
	template="/WEB-INF/templates/mainSearchLayout.xhtml">

	<ui:define name="title">
			<h:outputText value="#{resourceBundle['user.search.title']}" />
	</ui:define>
	
	<ui:define name="searchFields">
		<oso:inputText id="nameFilter" label="#{resourceBundle['name']}" value="#{userModel.filter.name}"/>
	</ui:define>

	<ui:define name="listValues">
		<ui:param name="listModel" value="#{userModel.list}" />
		<ui:param name="targetObject" value="#{userModel.editedEntity}" />
	</ui:define>


	<ui:define name="searchColumns">
		<p:column sortBy="#{row.username}">
			<f:facet name="header">
				<h:outputText value="#{resourceBundle['user.admin.completeName']}" />
			</f:facet>
			<h:outputText value="#{row.username}" />
		</p:column>
		<p:column sortBy="#{row.completeName}">
			<f:facet name="header">
				<h:outputText value="#{resourceBundle['user.admin.completeName']}" />
			</f:facet>
			<h:outputText value="#{row.completeName}" />
		</p:column>
	</ui:define>

	<ui:define name="actionColumns">
	    <p:commandLink action="prepareResetPassword"
		    title="#{resourceBundle['user.admin.resetPassword']}"
		    oncomplete="resetPasswordDialog.show();"
		    update=":resetPasswordForm:resetPasswordGrid">
		    <h:graphicImage value="/resources/images/password.png" />
		    <f:setPropertyActionListener target="#{targetObject}"
			    value="#{row}" />
	    </p:commandLink>

	</ui:define>

	<ui:define name="afterForm">
	    <ui:include src="resetPassword.xhtml" />
	</ui:define>
</ui:composition>
